﻿using System;
using System.Collections.Generic;
using System.Text;

namespace AudioPlayer.Plugin.Storage {
	/// <summary>
	/// Hold user settings
	/// </summary>
	public interface IUserSettings {
		/// <summary>
		/// Add user setting.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <param name="value">The value.</param>
		void Set(String name, Object value);
		/// <summary>
		/// Add user setting.
		/// </summary>
		/// <typeparam name="TField">The type of the field.</typeparam>
		/// <param name="name">The name.</param>
		/// <param name="value">The value.</param>
		void Set<TField>(String name, TField value);

		/// <summary>
		/// Removes user setting
		/// </summary>
		/// <param name="name">The name.</param>
		void Remove(String name);

		/// <summary>
		/// Gets user setting with specified name.
		/// </summary>
		/// <typeparam name="TField">The type of the field.</typeparam>
		/// <param name="name">The name.</param>
		/// <returns>NULL, or value.</returns>
		TField Get<TField>(String name);

		/// <summary>
		/// Gets user setting with specified name.
		/// </summary>
		/// <typeparam name="TField">The type of the field.</typeparam>
		/// <param name="name">The name.</param>
		/// <param name="def">The default value.</param>
		/// <returns>default value, or value</returns>
		TField Get<TField>(String name, TField def);

		/// <summary>
		/// Gets user setting with specified name.
		/// </summary>
		/// <param name="name">The name.</param>
		/// <returns></returns>
		Object Get(String name);

		/// <summary>
		/// Gets all names with founded owner.
		/// </summary>
		/// <returns>NULL if GUID doesn't contain any values, or Array.</returns>
		String[] Get();
	}
}
